/* Copyright Rex All rights reserved. */
enyo.kind({
	name: "com.RexToy.areaView",
	kind: com.RexToy.abstractCvtView,
	components: [
		{kind: "BasicScroller", components: [
			{kind: "RowGroup", components: [
				{name: "m2", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Square Meter")}
					]},
				{name: "km2", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Square Kilometer")}
					]},
				{name: "mi2", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Square Mile")}
					]},
				{name: "ft2", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Square Feet")}
					]},			
				{name: "rd", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Square Rood")}
					]},
				{name: "mu", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Mu(China)")}
					]}
			]}
		]}
      ],
	
	fomular: {
		"m2->m2": "m2",
		
		"m2->km2": "m2/1000000",
		"km2->m2": "km2*1000000",
		"m2->mi2": "m2/2589988.110336",
		"mi2->m2": "mi2*2589988.110336",
		"m2->ft2": "m2*10.7639104",
		"ft2->m2": "ft2/10.7639104",
		"m2->rd": "m2/4046.8564224",
		"rd->m2": "rd*4046.8564224",		
		"m2->mu": "m2*3/2000",
		"mu->m2": "mu*2000/3"
	},
	
	units: ["m2","km2","mi2","ft2","rd","mu"],
	baseUnit: "m2",
	
	blur: function(sender)
	{
		if(this.isNumber(sender))
		{
			this.calc(sender.name, this.getNumber(sender));
		}
	}
});